package com.ybf.user.dal.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 菜单级别
 *
 * @author 向南
 * @date 15:20 2023/6/6
 **/
@Getter
@AllArgsConstructor
public enum MenuLevelEnum {

    DIRECTORY(0,"目录"),

    MENU(1,"菜单"),

    BUTTON(2,"按钮");

    private Integer code;

    private String desc;

    public static MenuLevelEnum menuLevelEnum(Integer code){
        return Arrays.stream(MenuLevelEnum.values()).filter(f -> f.code.equals(code)).findFirst().orElse(null);
    }

}
